package com.sqllite.springbootsqlitejdbc.controller;

import com.sqllite.springbootsqlitejdbc.bean.CreditRealTimeParse;
import com.sqllite.springbootsqlitejdbc.service.CreditRealTimeParseService;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/credit")
public class CreditRealTimeParseController {
    private final CreditRealTimeParseService creditRealTimeParseService;

    public CreditRealTimeParseController(CreditRealTimeParseService creditRealTimeParseService) {
        this.creditRealTimeParseService = creditRealTimeParseService;
    }

    @PostMapping("callCreditRealTime")
    public void callCreditRealTime(@RequestParam String reportId) {
        creditRealTimeParseService.callCreditRealTime(reportId);
    }

    @PostMapping("getALlCreditRealTime")
    public List<CreditRealTimeParse> getAll() {
        return creditRealTimeParseService.getAll();
    }


}
